# 密码
export VNC_PASSWD=1234
# 桌面分辨率
export VNC_RESOLUTION=1920x1080
apt update
DEBIAN_FRONTEND=noninteractive apt-get install -y xfce4 xfce4-goodies tigervnc-standalone-server novnc tmux firefox ffmpeg
cp /usr/share/novnc/vnc.html /usr/share/novnc/index.html
mkdir -p ~/.vnc
tee ~/.vnc/xstartup <<-'EOF'
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
eval `dbus-launch --auto-syntax`
echo $DBUS_SESSION_BUS_ADDRESS > /tmp/dbus.txt
exec startxfce4 
EOF
chmod u+x ~/.vnc/xstartup
export USER=root
umask 077
echo $VNC_PASSWD | vncpasswd -f > ~/.vnc/passwd
vncserver -kill :1 | vncserver -geometry $VNC_RESOLUTION
tmux new-session -d /usr/share/novnc/utils/launch.sh --listen 9000 --vnc localhost:5901